# Standard Arrays

let array = [1  [2 3]  4 [5 6]]
for i in @array
    echo $i
end

for i in [1  [2 3]  4 [5 6]]
    echo $i
end

# Array Command Substitution

let array_process = [ @(echo a  b c d    e) ]
for i in @array_process
    echo $i
end

for i in @(echo a  b c d    e)
    echo $i
end

# Array Concatenation

let new_array = [@array @array_process]
for i in @new_array
    echo $i
end

# As Command Arguments

echo @array
echo @array_process
echo @new_array

# Slice by ID

let array = [ 1 2 3 ]
echo @array[0]
echo @array[1]
echo @array[2]

echo [ 1 2 3 ][0]
echo [ 1 2 3 ][1]
echo [ 1 2 3 ][2]

echo @(echo 1 2 3)[0]
echo @(echo 1 2 3)[1]
echo @(echo 1 2 3)[2]

# Slice by Range

let array = [ 1 2 3 4 5 ]
echo @array[0..1]
echo @array[0...1]
echo @array[..3]
echo @array[3..]
echo @array[..]

# Slice Syntax w/ variables
for index in 0..3
  echo $(echo 😉😉😉)[$index]
end

# Convert Array to String

let array = [ 1 2 3 4 5 ]
let as_string = @array
echo $as_string
